<?php
class Sb_Controller_Plugin_Auth extends  Sb_Controller_Plugin_Base
{
	public function dispatchLoopStartup( Zend_Controller_Request_Abstract $request )
	{
		$controller = $request->getControllerName( );
		if('auth' !== $controller && !Zend_Auth::getInstance( )->hasIdentity( )){
			$request->setParam('fromC', $controller)
					  ->setParam('fromA', $request->getActionName())
					  ->setParam('fromM', $request->getModuleName())
					  ->setActionName( 'login' )
	          		  ->setControllerName( 'auth' );
		}
	}
}